const state = () => ({
  position: {} //格式 data: { province, city }
})

const mutations = {
  // setPosition:(state, val) => {
  //可以简写
  setPosition(state, val) {
    state.position = val
  }
}

const actions = {
  setPosition({ commit }, position) {
    commit('setPosition', position)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
